<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<meta name='keywords' content="">
<meta name='description' content="">
<meta name='robots' content='all'>
<link rel="stylesheet" href="__APP__/resources/css/base.css" type="text/css" charset="utf-8"> 
<link rel="stylesheet" href="__APP__/resources/css/main.css" type="text/css" charset="utf-8">{$jcrop_css}
<script src="__APP__/resources/js/jquery-1.5.1.js"></script>
<script src="__APP__/resources/js/artDialog.min.js"></script>
<script src="__APP__/resources/js/plug.min.js"></script>{$jcrop_js}
<script type="text/javascript">
$(function(){
    $('#login').click(function(){
        art.dialog.load("{:U('member/login')}", {
            lock:true,
            id : 'login_dialog',
            width:300,
            height:100,
            title: '用户登录'
        }, true);
    })
    $('#reg').click(function(){
        art.dialog.load("{:U('member/register')}", {
            lock:true,
            id : 'reg_dialog',
            title: '用户注册'
        }, true);
    })
    
    $('#reg_cancel_btn').live('click',function(){
        art.dialog.get('reg_dialog').close();
    })
    $('#reg_btn').live('click',function(){
        $('#login_btn').attr('disabled',true);
        var err = new Array();
        err[1] = '验证码不正确。';
        err[2] = '非法。';
        err[3] = '两次输入密码不一致。';
        err[4] = 'username格式不正确。';
        err[5] = '用户名已存在。';
        err[6] = '用户名或密码不能为空。';
        err[7] = '用户名长度为6-50个字符。';
        err[8] = '密码长度为6-50个字符。';
        err[10] = '注册成功。';
        //$('#login_btn').attr('disabled',true);
        $.post("{:U('member/register')}", "username="+$("#username").val()+"&password="+$("#password").val()+"&confirm_password="+$('#confirm_password').val()+"&verify="+$('#verify').val()+'&{:C('TOKEN_NAME')}='+$("#{:C('TOKEN_NAME')}").val(), function(txt){
            if(typeof(err[txt]) != 'undefined'){
                $('#tip').html(err[txt]);
                $('#reg_btn').attr('disabled',false);
            }else{
                $('#tip').html('注册成功');
                $('#reg_btn').attr('disabled',false);
                window.location.reload();
            }
        },'json' );         
    })

    $('#cancel_btn').live('click',function(){
        art.dialog.get('login_dialog').close();
    })
    $('#login_btn').live('click',function(){
        $('#login_btn').attr('disabled',true);
        var err = new Array();
        err[1] = '用户不存在。';
        err[2] = '密码错误。';
        err[3] = '没有万能帐号...';
        //$('#login_btn').attr('disabled',true);
        $.post("{:U('member/loginPost')}", "username="+$("#username").val()+"&password="+$("#password").val(), function(txt){
            if(typeof(err[txt]) != 'undefined'){
                $('#tip').html(err[txt]);
                $('#login_btn').attr('disabled',false);
            }else{
                $('#tip').html('登录成功');
                $('#login_btn').attr('disabled',false);
                window.location.reload();
            }
        },'json' );         
    })
})
</script>
</head>
<body>

<div class="container">
	<!-- header -->
	<div class="header">
		<h1>
			<a href="http://www.souvo.com" title="搜我网">搜我网</a>
			<em>在这里展示自己的人已经有<span>54456</span>位了！</em>
		</h1>
		<div class="login">
        <php> if ($user) { </php>
            <span>欢迎:{$user_info.nickname}</span><a href="{:U('memcp/infoset')}" title="设置">设置</a><a href="#" title="通知">通知</a>
            <a href="{:U('memcp/sitesms')}" title="站内信">站内信</a><a href="{:U('member/logout')}" title="退出">退出</a>
        <php> }else{ </php>
			<a  title="登录" id="login">登录</a>
			<a href="javascript:void(0)" title="注册" id="reg">注册</a>
        <php> } </php>
        </div>
		<div class="search">
			<span class="city"><em>选择城市</em><q></q></span>
			<span class="schCont">
				<input type="text" class="text" />
				<input type="submit" class="schBtn" value="搜索" />
			</span>
			<input type="hidden" name="city"/>
		</div>
		<!-- 导航 -->
		<div class="navi">
			<ul>
                <php> if ($user) { $url = 'people/'.$user['mid']; $people_nav_curr = 'people_'.$user['mid'];</php>
                    <li{$currTopNav['main_index']}><a href="{:U('main/index')}"><em>首页</em></a></li>
                    <li{$currTopNav.memcp_collect}><a href="{:U('memcp/collect')}"><em>我的收藏</em></a></li>
                    <li{$currTopNav.people_explore}><a href="{:U('people/explore')}"><em>可能感兴趣的</em></a></li>
                    <li{$currTopNav.$people_nav_curr}><a href="{:U($url)}"><em>个人主页</em></a></li>
                <php> }else{ </php>
                    <li{$currTopNav['main_index']}><a href="{:U('main/index')}"><em>首页</em></a></li>
                    <li{$currTopNav['main_people']}><a href="{:U('main/people')}"><em>人物</em></a></li>
                    <li{$currTopNav['main_blog']}><a href="{:U('main/blog')}"><em>搜我志</em></a></li>
                <php> } </php>
			</ul>

			<div class="share">
				分享到：
				<a href="javascript:void(0)" class="goQQ" title="分享到QQ空间">QQ空间</a>
				<a href="javascript:void(0)" class="goSina" title="分享到新浪微薄">新浪微薄</a>
				<a href="javascript:void(0)" class="goKaixin" title="分享到开心网">开心网</a>
				<a href="javascript:void(0)" class="goRenren" title="分享到人人网">人人网</a>
				<a href="javascript:void(0)" class="goDouban" title="分享到豆瓣">豆瓣</a>
			</div>
		</div>
	</div>
    <!-- header End -->